Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Default endpoints and gateway accessors are cached between requests #337

Merged

Conversation

MarquessV
Copy link
Contributor

@MarquessV MarquessV commented Jul 28, 2023

Resolves #336.

Two open questions:

  • Is one hour a reasonable TTL? (Since this is client-side and the addresses should be very static, do we even need a TTL?)
  • Is it important to split the test in mocked_qpu into two tests, one for default_endpoint and one for accessors?

@kalzoo
Copy link
Contributor

kalzoo commented Jul 28, 2023

This looks like the right approach. I'd further split the new function into get_accessor and get_accessor_[from|with]_cache to allow for uncached access if/when needed, but given that it's a private function that's only stylistic at this point

crates/lib/Cargo.toml Outdated Show resolved Hide resolved
crates/lib/src/qpu/api.rs Outdated Show resolved Hide resolved
@BatmanAoD BatmanAoD changed the title feat: Gateway accessors are cached between requests feat: Default endpoints and gateway accessors are cached between requests Aug 1, 2023
@BatmanAoD BatmanAoD marked this pull request as ready for review August 1, 2023 17:52
Copy link
Contributor Author

@MarquessV MarquessV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't approve since I'm the original author, and still interested in @kalzoo's take on the TTL for the cache, but looks good to me!

crates/lib/src/qpu/api.rs Show resolved Hide resolved
Copy link
Contributor

@BatmanAoD BatmanAoD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving because Marquess commented approval and Kalan provided feedback on TTL.

@BatmanAoD BatmanAoD merged commit 87b211e into main Aug 3, 2023
2 checks passed
@BatmanAoD BatmanAoD deleted the 336-the-gateway-accessor-for-a-qpu-id-should-be-cached branch August 3, 2023 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The gateway accessor and default-endpoint for a QPU ID should be cached
4 participants